###
 # @Company: TWL
 # @Author: xue jian
 # @Email: xuejian@kanzhun.com
 # @Date: 2020-06-20 17:04:50
### 

main() {
    day=$1
    make_boss_rank_chat_file $day
    # make_boss_xuchen_chat $day
}

make_boss_rank_chat_file(){
    day=$1
    sql_rank_chat_file="
    set mapreduce.job.queuename=boss.arc.six.vip;
    select boss_l1code,boss_l2code,boss_position,boss_city,geek_position,geek_city,
    boss_id,job_id,geek_id,exp_id,page,rank,list_time,deal_time,deal_type,
    detailed_deal_type,jl,jh,job_workyears,job_degree,geek_gender,geek_degree,
    geek_degree_new,geek_school_level,geek_cmp_level,geek_apply_status,geek_workyears,
    el,eh,boss_cmp_level,boss_title_type,geek_plist_times_14d,geek_pdet_times_14d,
    geek_paddf_times_14d,geek_paddfchat_times_7d,geek_psuccess_times_7d,geek_pdet_times_7d,
    geek_paddf_pchat_times_7d,geek_paddf_success_times_7d,geek_paddf_times_7d,
    geek_paddfchat_times_2d,geek_psuccess_times_2d,geek_pdet_times_2d,geek_paddf_pchat_times_2d,
    geek_paddf_success_times_2d,geek_paddf_times_2d,geek_paddfchat_rate_2d,geek_psuccess_rate_2d,
    geek_paddf_pchat_rate_2d,geek_paddf_success_rate_2d,geek_paddf_rate_2d,geek_paddfchat_rate_7d,
    geek_psuccess_rate_7d,geek_paddf_pchat_rate_7d,geek_paddf_success_rate_7d,geek_paddf_rate_7d,
    geek_pdet_rate_14d,geek_paddf_rate_14d,geek_work_p,geek_school_type1,geek_school_type2,geek_major,
    geek_last_work_skill,geek_district_code,geek_business_code,geek_job_hopping,geek_school_ids,
    geek_cmp_pas_addf_rate,geek_sch_pas_addf_rate,boss_addf_geek_id_vector,boss_addf_expect_id_vector,
    job_addf_geek_id_vector,job_addf_expect_id_vector,b2g_salary_recent10_realtime,
    b2g_apply_status_recent10_realtime,b2g_gender_recent10_realtime,b2g_degree_recent10_realtime,
    b2g_school_type2_recent10_realtime,b2g_school_type1_recent10_realtime,
    b2g_school_level_recent10_realtime,b2g_cmp_level_recent10_realtime,b2g_workyears_recent10_realtime,
    geek_rev_work_year,req_id,ds
    from arc.bossrec_train_rtf_all where ds='$day'
    ;"
    filedir=/data3/training_data/arc_six/bossrec_rank_chat_oridata
    mkdir -p $filedir
    filedir=$filedir/$day
    hive -e "$sql_rank_chat_file" > $filedir
}

make_boss_xuchen_chat(){
    day=$1
    sql_rank_chat_file="
    select *
    from mining.bossrec_train_deep_new where ds='$day'
    ;"
    filedir=/data3/training_data/arc_six/bossrec_rank_chat_oridata_xuchen
    mkdir -p $filedir
    filedir=$filedir/$day
    hive -e "$sql_rank_chat_file" > $filedir
}


datebeg="2020-06-21"
dateend="2020-06-21"
beg_s=`date -d "$datebeg" +%s`
end_s=`date -d "$dateend" +%s`
while [ "$beg_s" -le "$end_s" ]
do
    tmp=`date -d @$beg_s +"%Y-%m-%d"`
    echo $tmp
    main $tmp
    beg_s=$((beg_s+86400))
done